package mapping

import (
	"ota/model"
	"ota/model/entity"
)

// FirmwaresEntityToDto entity data transfer
func FirmwaresEntityToDto(firmwares []*entity.Firmware) []*model.FirmwareInfo {
	out := make([]*model.FirmwareInfo, 0, len(firmwares))
	for _, c := range firmwares {
		out = append(out, FirmwareEntityToDto(c))
	}
	return out
}

// FirmwareEntityToDto entity data transfer
func FirmwareEntityToDto(e *entity.Firmware) *model.FirmwareInfo {
	return &model.FirmwareInfo{

		Id: e.Id,

		TypeIds: e.TypeIds,

		Name: e.Name,

		FileSize: e.FileSize,

		Description: e.Description,

		Version: e.Version,

		FilePath: e.FilePath,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
